SRCDIR=./src
OBJDIR=./obj
BINDIR=./build
EXECUTABLE=temp.exe
SOURCES=\
	main.cpp\
	pcap_handler.cpp\
	bitwise.cpp\
	settings.cpp\

LIBS=\
	-lWS2_32\
	-lwpcap\
#-lboost_system\

CC=g++
CFLAGS=-c -Wall
LDFLAGS=-s
VPATH=$(OBJDIR) $(SRCDIR) $(BINDIR)
TEMPOBJECTS=$(SOURCES:.cpp=.o)
OBJECTS=$(TEMPOBJECTS:%=$(OBJDIR)/%)

all: $(SOURCES) $(EXECUTABLE)
# Create unlinked objects.
.cpp.o:
	$(CC) $(CFLAGS) $< -o $(OBJDIR)/$@ 
# Link compiled objects.
$(EXECUTABLE): $(TEMPOBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) -o $(BINDIR)/$@ \
	  $(LIBS)

.PHONY: wipe clean
wipe : clean
	rm -f $(BINDIR)/$(EXECUTABLE)
clean :
	rm -f $(OBJDIR)/*.o

